#include "debug.h"
#include "../Driver/adc/adc.h"
#include "../Driver/timer/tim_pwm.h"

int main(void)
{
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
    Delay_Init();
    USART_Printf_Init(115200);
    printf("SystemClk:%d\r\n", SystemCoreClock);

    TimPwmInit(TIM_PERIOD, TIM_PRESCALER);
    AdcInit();

    while(1)
    {
        TIM_SetCompare1(TIM1, GetAdcValue(ADC_Channel_2)/45);
        printf("%d\r\n",GetAdcValue(ADC_Channel_2)/45);
    }
}
